Don't allocate space for "" in scale marks
authorMatthias Clasen <mclasen@redhat.com>
Thu, 5 Aug 2010 01:47:54 +0000 (21:47 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 5 Aug 2010 01:47:54 +0000 (21:47 -0400)
Turns out GtkBuilder ends up creating marks with non-NULL
empty texts, so ignore those. Bug 614443, reported by Filippo Argiolas.

gtk/gtkscale.c

index c8a82cce30cf4701fec1939b5caa4b58a19f4237..eb930ba6eeb4805d726a3b4c0843b3b2e8bbaa40 100644 (file)
@@ -852,7 +852,7 @@ gtk_scale_get_mark_label_size (GtkScale        *scale,
     {
       GtkScaleMark *mark = m->data;
 
-      if (mark->markup)
+      if (mark->markup && *mark->markup)
         {
           pango_layout_set_markup (layout, mark->markup, -1);
           pango_layout_get_pixel_extents (layout, NULL, &logical_rect);